#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
int n, m;
struct node
{
	int s;
	int idx;
}S[N];
int a[N];
bool cmp(node a, node b)
{
	if (a.s != b.s) {
		return a.s < b.s;
	}
	return a.idx < b.idx;
}
int main()
{
	cin >> n >> m;
	bool flag = 0;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		a[i] += a[i - 1];
		S[i] = { a[i],i };
	}
	sort(S, S + n + 1, cmp);
	while (m--) {
		int k;
		cin >> k;
		int l = 0, r = n + 1;
		while (l + 1 != r) {
			int mid = (l + r) >> 1;
			if (S[mid].s <= k) {
				l = mid;
			}
			else {
				r = mid;
			}
		}
		cout << S[l].idx << endl;
	}
	return 0;
}